Class TreeNode<T extends TreeNodeInfo>
- java.lang.Object
-
- edu.claflin.finder.logic.communities.struct.TreeNode<T>
-
- All Implemented Interfaces:
java.lang.Comparable<TreeNode>
public class TreeNode<T extends TreeNodeInfo> extends java.lang.Object implements java.lang.Comparable<TreeNode>
The basic unit of the BinarySearchTree.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(TreeNode that)TreeNode<T>duplicate()booleanequals(java.lang.Object o)TgetInfo()TreeNodegetLeftChild()Get the left child TreeNode.TreeNodegetRightChild()Get the right child TreeNode.voidsetInfo(T info)Set the information of this TreeNode.voidsetLeftChild(TreeNode left)Set the left child TreeNode.voidsetNode(T info, TreeNode<T> l, TreeNode<T> r)Set all the information of this TreeNode.voidsetRightChild(TreeNode right)Set the right child TreeNode.java.lang.StringtoString()
-
-
-
Field Detail
-
info
private T extends TreeNodeInfo info
-
left
private TreeNode left
-
right
private TreeNode right
-
-
Method Detail
-
getInfo
public T getInfo()
-
getLeftChild
public TreeNode getLeftChild()
Get the left child TreeNode.- Returns:
- the left child TreeNode
-
getRightChild
public TreeNode getRightChild()
Get the right child TreeNode.- Returns:
- the right child TreeNode
-
setNode
public void setNode(T info, TreeNode<T> l, TreeNode<T> r)
Set all the information of this TreeNode.- Parameters:
info- the informationl- the left child TreeNoder- the right child TreeNode
-
setInfo
public void setInfo(T info)
Set the information of this TreeNode.- Parameters:
info- the info to set
-
setLeftChild
public void setLeftChild(TreeNode left)
Set the left child TreeNode.- Parameters:
left- the left child TreeNode
-
setRightChild
public void setRightChild(TreeNode right)
Set the right child TreeNode.- Parameters:
right- the right child TreeNode
-
compareTo
public int compareTo(TreeNode that)
- Specified by:
compareToin interfacejava.lang.Comparable<T extends TreeNodeInfo>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-